import request from '@/utils/request';
import type { HttpResult } from '@/api';
import type { LoginParams, UserInfo } from './model/index';

// 登录
export const login = async (data: LoginParams): Promise<HttpResult<string>> => {
  const res = await request.post<HttpResult<string>>(
    '/auth/sysUser/login',
    data,
  );
  return res.data;
};

// 获取登录用户的信息
export const getUserInfo = async (): Promise<HttpResult<UserInfo>> => {
  const res = await request.post<HttpResult<UserInfo>>(
    '/auth/sysUser/userInfo'
  );
  return res.data;
};

